package cn.wolfcode.luowowo.item.service.impl;

import cn.wolfcode.luowowo.item.domain.Item;
import cn.wolfcode.luowowo.item.mapper.ItemMapper;
import cn.wolfcode.luowowo.item.query.ItemQuery;
import cn.wolfcode.luowowo.item.service.IItemService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class ItemServiceImpl implements IItemService {
    @Autowired
    private ItemMapper itemMapper;

    @Override
    public PageInfo queryForList(ItemQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize());
        List<Item> list = itemMapper.selectForList(qo);
        return new PageInfo(list);
    }
}
